package com.tuniu.agents.command;

import java.util.Map;

/**
 * Command interface
 * Defines the basic properties and behaviors of a command
 * Commands are stateful and can store and modify state
 */
public interface Command extends Comparable<Command> {

    /**
     * Get the command name
     *
     * @return command name
     */
    String getCommandName();

    /**
     * Get the priority of the command, the smaller the number, the higher the priority
     *
     * @return priority
     */
    int getPriority();

    /**
     * Get the command matcher
     *
     * @return command matcher
     */
    CommandMatch getMatch();

    /**
     * Get the command action
     *
     * @return command action
     */
    CommandAction getAction();

    /**
     * Compare the priority of two commands
     *
     * @param other other command
     * @return comparison result
     */
    @Override
    int compareTo(Command command);

    /**
     * Get the command ID
     *
     * @return command ID
     */
    String getId();

    /**
     * Get the command description
     *
     * @return command description
     */
    String getDescription();

    /**
     * Get the command parameters
     *
     * @return command parameters
     */
    Map<String, Object> getParams();

    /**
     * Get the command lifecycle
     *
     * @return command lifecycle
     */
    CommandLifecycle getLifecycle();

    /**
     * Set the command parameters
     *
     * @param params command parameters
     */
    void setParams(Map<String, Object> params);

}
